package com.ltu.util.common;

import java.util.UUID;

public class UUIDGenerator {
	/**
	 * 
	 * @time:2018年10月13日
	 * @author:若尘
	 * @Description:获取全球唯一识别码的类
	 * @param:@return
	 * @return:String
	 */
	 public static String getUUID() { 
		UUID uuid = UUID.randomUUID();
		String str = uuid.toString();
		// 去掉"-"符号
		String temp = str.substring(0, 8) + str.substring(9, 13) + str.substring(14, 18) + str.substring(19, 23) + str.substring(24);
		return temp;
	 }
	//获得指定数量的UUID
	public static String[] getUUID(int number) {
		if (number < 1) {
			return null;
		}
		String[] ss = new String[number];
		for (int i = 0; i < number; i++) {
			ss[i] = getUUID();
		}
		return ss;
	}
}
